<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script type="module">
        // js nlp stansformers.js
        // transformers.js  nlp 框架
        // 下载LLM
        // pipeline  核心模块  
       import {
        pipeline, // pipe 模块， 派出一个任务
        env // 环境
       } from 'https://cdn.jsdmirror.com/npm/@xenova/transformers@2.6.0'
       env.allowLocalModels = false; // 不要加载本地大模型
// react  loading 组件告知用户？ 
       let pipe = await pipeline('sentiment-analysis'); // 分类  download LLM
       let result = await pipe('I love transformers')
       console.log(result);
       let result2 = await pipe('I hate transformers')
       console.log(result2);
    </script>

</body>
</html>